﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyVoteMVC.Domain.VT_Questions>" %>
<ul class="splitter">
    <li>
        <%= Model.Question_Title%>:<%= Model.Question_Content %></li></ul>
<%= Html.Telerik().Grid<ProjectItem>()
        .Name("Grid")
        .DataKeys(keys =>
        {
            keys.Add(p => p.ID);
        })        
        .DataBinding(dataBinding =>
            dataBinding.Ajax()
                  .Select("_ListItemByQuestionId", "Project", new { id = Model.Question_ID })
        )
        .Columns(columns =>
        {
            columns.Bound(p => p.ID).Hidden(true);
            columns.Bound(p => p.ID).Width(60).Title("")
                   .ClientTemplate("<input type='checkbox' name='<#=QID#>' pid='<#=PID#>' value='<#=ID#>' <#= Selected? checked='checked' : '' #> />");
            columns.Bound(p => p.pName).Title("项目名");
            columns.Bound(p => p.pYear).Width(130).Title("项目年份");
            columns.Bound(p => p.pType).Width(130).Title("项目类型");
            columns.Bound(p => p.pYearGroup).Width(130);
            
        })
        .ClientEvents(events =>
                events.OnRowSelect("onRowSelect"))
        .Selectable()
        .Pageable(page => page.PageSize(30))
        .Scrollable(scroll=>scroll.Height(500))
        .Sortable()
%>